QT       += core gui multimedia network

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

DEFINES += USE_OPENCV

CONFIG += c++17
CONFIG += qt warn_on
#CONFIG += release

unix:!macx {
    QT +=    x11extras

    CONFIG += link_pkgconfig
    PKGCONFIG += x11 xext

    QMAKE_LFLAGS += "-Wl,-rpath,\'\$$ORIGIN\'"
    QMAKE_LIBDIR_FLAGS += -Wl,-rpath=./:/opt/DualSystemDesktop

    contains(DEFINES, USE_OPENCV){
        INCLUDEPATH += /usr/include/opencv4
        LIBS += /usr/lib/x86_64-linux-gnu/libopencv_core.so
        LIBS += /usr/lib/x86_64-linux-gnu/libopencv_imgproc.so
        LIBS += /usr/lib/x86_64-linux-gnu/libopencv_videoio.so
        LIBS += /usr/lib/x86_64-linux-gnu/libopencv_face.so
        LIBS += /usr/lib/x86_64-linux-gnu/libopencv_objdetect.so
    }

    ## apt install libpam0g-dev
    ## apt install libpam-cracklib
    INCLUDEPATH += /usr/include/security/
    LIBS += -lpam
    # LIBS += -lpam_misc
}

msvc {
    QMAKE_CFLAGS += /utf-8
    QMAKE_CXXFLAGS += /utf-8
}


# not support for windows. keep remained for test
win32 {
    msvc:LIBS += Advapi32.lib
    gcc:LIBS += -ladvapi32

    contains(DEFINES, USE_OPENCV){
        INCLUDEPATH += D:\my_libs\opencv-4.4.0\build\install\include
        LIBS += D:\my_libs\opencv-4.4.0\build\install\lib\opencv_world440.lib
    }
}


# You can make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
    src/authenticate/loginlogical.cpp \
    src/authenticate/acctauthenticate.cpp \
    src/authenticate/faceauthenticate_cv.cpp \
    src/authenticate/faceauthenticate_cw.cpp \
    src/authenticate/faceauthinterface.cpp \
    src/baseui/battery.cpp \
    src/baseui/arrowwidget.cpp \
    src/baseui/faceanimationwidget.cpp \
    src/baseui/keyinputwidget.cpp \
    src/baseui/systemrebootdialog.cpp \
    src/baseui/messagetoast.cpp \
    src/baseui/baseshadowdialog.cpp \
    src/common/localsetting.cpp \
    src/common/batteryinfo.cpp \
    src/common/xwindowmanager.cpp \
    src/common/screenmanager.cpp \
    src/common/singleapplication.cpp \
    src/common/singleapplication_p.cpp \
    src/main.cpp \
    src/subwindow.cpp \
    src/mainwindow.cpp

HEADERS += \
    src/authenticate/loginlogical.h \
    src/authenticate/acctauthenticate.h \
    src/authenticate/faceauthenticate_cv.h \
    src/authenticate/faceauthenticate_cw.h \
    src/authenticate/faceauthinterface.h \
    src/baseui/battery.h \
    src/baseui/arrowwidget.h \
    src/baseui/faceanimationwidget.h \
    src/baseui/keyinputwidget.h \
    src/baseui/systemrebootdialog.h \
    src/baseui/messagetoast.h \
    src/baseui/baseshadowdialog.h \
    src/common/localsetting.h \
    src/common/batteryinfo.h \
    src/common/xwindowmanager.h \
    src/common/screenmanager.h \
    src/common/singleapplication.h \
    src/common/singleapplication_p.h \
    src/utils/log.h \
    src/utils/version.h \
    src/subwindow.h \
    src/mainwindow.h

FORMS += \
    src/baseui/keyinputwidget.ui \
    src/baseui/systemrebootdialog.ui \
    src/baseui/messagetoastwidget.ui \
    src/subwindow.ui \
    src/mainwindow.ui

RESOURCES += \
    resource/xcscreensaver.qrc


DISTFILES += \
    README.md \
    CMakeLists.txt \
    resource/xcscreensaver.qss



# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target




